#pragma once
#include "aot_inet_config.h"
#include <interface/aot_inet_interface.h>

class tcp_syn_event_handler;
class tcp_syn_channel_impl : public aot::inet::itcp_syn_channel
{
public:
	tcp_syn_channel_impl(void);
public:
	virtual ~tcp_syn_channel_impl(void);
public:
	virtual void set_dummy_http_tunnel_host(const char* host_name, int host_port);
	virtual void set_proxy(const char* ip, int port, const char* user, const char* pwd, int proxy_type);
	virtual void clr_proxy();
	virtual bool test_proxy(const char* proxy_host_name, int proxy_port, const char* proxy_auth, const char* forward_host_name, int forward_host_port, 
		const aot::inet::inet_time_t* tm_out, int* ret_code);
	virtual int connect(const char* ip, int port, int serv_type, const aot::inet::inet_time_t* tm_out = NULL);
	virtual void set_heartbeat_time(const aot::inet::inet_time_t* tm, const aot::inet::inet_time_t* max_tm_out);
	virtual int send(aot::inet::ipacket* pkt, const aot::inet::inet_time_t* tm_out = NULL);
	virtual int recv(aot::inet::ipacket** pkt, const aot::inet::inet_time_t* tm_out = NULL);
	virtual void close();
	virtual void set_send_buf_size(size_t size);
	virtual void set_recv_buf_size(size_t size);
	virtual aot::inet::inet_addr_t* local_addr();
	virtual aot::inet::inet_addr_t* remote_addr();
public:
	tcp_syn_event_handler* ev_;
};
